#include <iostream>
#include <string.h>
#include <assert.h>
#include <limits>
#include <ctime>

#include "a.h"

using namespace std;//使用std命名空间，命名空间是C++中一个相对新的概念

int my_sum(int a, int b = 20);


int main(int argc, char const *argv[])
{
	cout << "Hello World" << endl;

	cout << "bool max:" << (numeric_limits<bool>::max)() << endl;
	cout << "bool min:" << (numeric_limits<bool>::min)() << endl;

	string str = "aaa";
	str += "bbb";
	cout << "str = " << str << endl;

	int a = 10;
	int &r = a; //r是一个初始化为a的整型引用
	cout << "a = " << a << endl;
	r = 15;
	cout << "a = " << a << endl;

	int c = my_sum(a);
	cout << "c = " << c << endl;

	// 基于当前系统的当前日期/时间
	time_t now = time(0);

	// 把 now 转换为字符串形式
	char *dt = ctime(&now);
	cout << "本地日期和时间：" << dt << endl;
	// 把 now 转换为 tm 结构
	tm *gmtm = gmtime(&now);
	dt = asctime(gmtm);
	cout << "UTC 日期和时间：" << dt << endl;

	// char name[10];
	// int age;
	// cout << "请输入你的名称和年龄：";
	// cin >> name >> age;
	// cout << "你的名字是：" << name << "\t你的年龄是：" << age << endl;

	char ar[] = "Unable to read...";
	cerr << "Error Message : " << ar << endl;
	clog << "Log Information : " << ar << endl;

	box1.set(10, 5, 2);
	cout << "体积 = " << (box1.get()) << endl;

	return 0;
}

int my_sum(int a, int b)
{
	int c = a + b;
	return c;
}
